/**
 * Created by Administrator on 2019/1/31.
 */
$(function () {
   // 加载公告信息
    loadNotice();
});

var loadNotice = function () {
    var jsonstr = postSyncAjax("/notice/load", null);
    //console.log(jsonstr);
    if(jsonstr.success) {
        $("#notice_board").html("");
        $.each(jsonstr.data, function (index, item) {
            //console.log(item);
            var targetObj = $("#notice_board").append("<div class=\"swiper-slide\"><div class='swiper-slide-title'>" +
                item.noticeTitle + "</div><br/><div class='swiper-slide-content'>" +"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
                item.noticeContent + "</div><br/><div class='swiper-slide-man'>" + item.entryNickname +
                "</div><br/><div class='swiper-slide-time'>" +
                top.dateFtt("yyyy-MM-dd hh:mm:ss", new Date(item.entryTime)) +
                "</div></div>");
            $.parser.parse(targetObj);// 重新渲染某个特定的组件，解决样式丢失的问题
        });
    } else {
        $("body").html("").css("background-color","#fff");
    }
}